﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.Text;

namespace Volo.Abp.SqlSugarCore
{
    public class SqlSugarClientConfigSetting
    {
        private static List<Action<ISqlSugarClient>> Actions { get; set; }
        static SqlSugarClientConfigSetting()
        {
            Actions = new List<Action<ISqlSugarClient>>();
        }

        public void AddSugarClientConfigAction(Action<ISqlSugarClient> action)
        {
            Actions.Add(action);
        }

        public void ExecSugarClientConfigAction(ISqlSugarClient sqlSugarClient)
        {
            Actions.ForEach(e => e?.Invoke(sqlSugarClient));
        }
    }
}
